DBEngine Object Example

This example enumerates the collections of the DBEngine object. See the methods and properties of DBEngine for additional examples.

Sub DBEngineX()

    Dim wrkLoop As Workspace
    Dim prpLoop As Property

    With DBEngine
        Debug.Print "DBEngine Properties"

        ' Enumerate Properties collection of DBEngine, 
        ' trapping for properties whose values are 
        ' invalid in this context.
        For Each prpLoop In .Properties
            On Error Resume Next
            Debug.Print "  " & prpLoop.Name & " = " _
                & prpLoop
            On Error GoTo 0
        Next prpLoop

        Debug.Print "Workspaces collection of DBEngine"

        ' Enumerate Workspaces collection of DBEngine.
        For Each wrkLoop In .Workspaces
            Debug.Print "  " & wrkLoop.Name

            ' Enumerate Properties collection of each 
            ' Workspace object, trapping for properties 
            ' whose values are invalid in this context.
            For Each prpLoop In wrkLoop.Properties
                On Error Resume Next
                Debug.Print "    " & prpLoop.Name & _
                    " = " & prpLoop
                On Error GoTo 0
            Next prpLoop

        Next wrkLoop

    End With

End Sub